

<div id="canvasQzDiv2" style="height: 395px;width:650px;">
</div>

<script>
    $(function () {
        var myCharts = echarts.init(document.getElementById("canvasQzDiv2"));
        $.ajax({
            url: '${absoluteContextPath}/ajaxQzBylState',
            type: 'post',
            success: function (data) {
                var data = JSON.parse(data);
                var dateline = ['上四周', '上三周', '上二周', '上一周', '本周']
                var datelegend = [];
                for (var i = 0; i < data.content.length; i++) {
                    datelegend[i] = data.content[i].groud;

                }
                var data1 = [data.content[0].spareE, data.content[0].spareD, data.content[0].spareC, data.content[0].spareB,  data.content[0].spareA];
                var data2 = [data.content[1].spareE, data.content[1].spareD, data.content[1].spareC, data.content[1].spareB,  data.content[1].spareA];
                var data3 = [data.content[2].spareE, data.content[2].spareD, data.content[2].spareC, data.content[2].spareB,  data.content[2].spareA];

                var options = {
                    title : {
                   text: '保有量比率趋势图',

                    },
                    tooltip: {
                        trigger: 'axis'

                    },
                    legend: {
                        data:datelegend,
                        x:'right'
                    },
                    grid: {
                        x: '12%',
                        y: '12%',
                        width: '90%',
                    },
                    calculable: true,
                    xAxis: [
                        {
                            type: 'category',
                            data: dateline,
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value',
                            max:0.999,

                            axisLabel: {
                                formatter: '{value} '
                            }
                        }
                    ],
                    series: [
                        {
                            name: datelegend[0],
                            type: 'line',
                            itemStyle: {
                                normal: {
                                    label: {
                                        show: true,
                                        position: 'top',


                                    }
                                }
                            },
                            data: data1,
                        },
                        {
                            name: datelegend[1],
                            type: 'line',
                            itemStyle: {
                                normal: {
                                    label: {
                                        show: true,
                                        position: 'top',

                                    }
                                }
                            },
                            data: data2,
                        },
                        {
                            name: datelegend[2],
                            type: 'line',
                            itemStyle: {
                                normal: {
                                    label: {
                                        show: true,
                                        position: 'top',

                                    }
                                }
                            },
                            data: data3,
                        },
                    ]
                };
                myCharts.setOption(options);
                myCharts.on(echarts.config.EVENT.CLICK, eConsole1);
            }
        });
    });
</script>